package cn.edu.eight.food.service.Impl;


import cn.edu.eight.food.dao.OfFoodMapper;
import cn.edu.eight.food.model.Foods;
import cn.edu.eight.food.model.OfFood;
import cn.edu.eight.food.service.ofFoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ofFoodServiceImpl implements ofFoodService {
    @Autowired
    OfFoodMapper ofFoodMapper;

    @Override
    public int insert(OfFood record) {
        return ofFoodMapper.insert(record);
    }

    @Override
    public List<Foods> foods(int hot, String foodName) {
        return ofFoodMapper.foods(hot,foodName);
    }

    @Override
    public int updateFood(OfFood record) {
        return ofFoodMapper.updateFood(record);
    }

    @Override
    public int deleteFood(String foodId) {
        return ofFoodMapper.deleteFood(foodId);
    }

    @Override
    public List<OfFood> foodList(int hot) {
        return ofFoodMapper.foodList(hot);
    }

    @Override
    public OfFood findByIdFood(String foodId) {
        return ofFoodMapper.findByIdFood(foodId);
    }
}
